<%@ Page Language="C#" MasterPageFile="~/MP/Classic.master" AutoEventWireup="true"
    CodeFile="AddWorkflow.aspx.cs" Inherits="ConfigCusto_Process_AddWorkflow" %>

<asp:Content ID="Content1" ContentPlaceHolderID="PageContainer" runat="Server">
    <h3>
        Workflow Editor</h3>
    <p>
        Name:<asp:TextBox ID="ProcessNameTextBox" runat="server"></asp:TextBox>
        <asp:RequiredFieldValidator ID="ProcessNameRequired" runat="server" ErrorMessage="Name is required." ControlToValidate="ProcessNameTextBox" SetFocusOnError="True">*</asp:RequiredFieldValidator>
    </p>
    <h4>
        Steps:</h4>
    <p>
        Each step must have a different name.<br />
        Step names must not include white spaces.
    </p>
    <p>
        <asp:GridView ID="ProcessStepsGridView" runat="server" AutoGenerateColumns="False"
            Width="100%" OnRowDataBound="ProcessStepsGridView_RowDataBound" OnRowCommand="ProcessStepsGridView_RowCommand"
            OnRowCreated="ProcessStepsGridView_RowCreated" ShowFooter="True" BorderWidth="0px">
            <Columns>            
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:Image ID="ImgStep" runat="server" />
                    </ItemTemplate>                    
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButtonDelete" CommandName="deleteStep" runat="server" ImageUrl="~/imx/delete.PNG" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButtonMoveUp" CommandName="moveUpStep" runat="server" ImageUrl="~/imx/up.PNG" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField>
                    <ItemTemplate>
                        <asp:ImageButton ID="ImageButtonMoveDown" CommandName="moveDownStep" runat="server"
                            ImageUrl="~/imx/down.PNG" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Name">
                    <ItemTemplate>
                        <asp:TextBox ID="NameTextBox" runat="server" Width="100px" Text='<%# Eval("Name") %>'></asp:TextBox> <asp:RequiredFieldValidator ID="NameRequired" runat="server" ErrorMessage="*" ControlToValidate="NameTextBox">*</asp:RequiredFieldValidator>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Type">
                    <ItemTemplate>
                        <asp:DropDownList ID="TypeDropDown" runat="server" AutoPostBack="True" OnSelectedIndexChanged="TypeDropDown_SelectedIndexChanged"
                            Width="100px">
                        </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Role">
                    <ItemTemplate>
                        <asp:DropDownList ID="RoleDropDown" runat="server" Width="100px">
                        </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>
    </p>
    <p>
        <asp:Label ID="ErrorMessageLabel" ForeColor="red" runat="server" Text="" />
    </p>
    <asp:Button ID="AddButton" runat="server" OnClick="AddButton_Click" Text="Add Step" />
    <asp:Button ID="SaveButton" runat="server" Text="Save" OnClick="SaveButton_Click" />
    <asp:Button ID="CancelButton" runat="server" OnClick="CancelButton_Click" Text="Cancel" />
</asp:Content>
